package org.example.test;

import org.example.controller.UserController;
import org.example.entity.User;
import org.example.entity.User1;
import org.example.entity.values;
import org.example.service.Userservice;
import org.example.service.impl.Userserviceimpl;
import org.example.service.impl.Userserviceimpl1;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.lang.reflect.Proxy;

public class test {
    public static void main(String[] args) {

        Userserviceimpl userserviceimpl = new Userserviceimpl();
        Userserviceimpl1 userserviceimpl1 = new Userserviceimpl1(userserviceimpl);
        Userservice o = (Userservice) Proxy.newProxyInstance(test.class.getClassLoader(),//类加载器
                userserviceimpl.getClass().getInterfaces(),//通过反射获取接口
                userserviceimpl1);//需要代理的对象
        o.dadd();


    }
}
